package com.atguigu.ggkt.gateway;

import com.atguigu.ggkt.utils.HostIPTool;
import com.atguigu.ggkt.utils.SpringTool;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
@EnableDiscoveryClient
public class ApiGatewayApplication {
    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(ApiGatewayApplication.class, args);
        SpringTool.setApplicationContext(context);
        String port = (String) SpringTool.getProperty("server.port");
        String ip = HostIPTool.getAddress().getHostAddress();
        System.out.println("http://"+ip+":"+port);
    }
}
